package com.itheima.d2_reflect2;

public class Student {
    public String name;
    private int age;
    private String hobby;

    public Student() {
        System.out.println("无参构造方法");
    }

    private Student(String name, int age, String hobby) {
        System.out.println("有参构造方法");
        this.name = name;
        this.age = age;
        this.hobby = hobby;
    }
    public void study(){
        System.out.println("学习中");
    }
    private void eat(){
        System.out.println("吃饭中");
    }private String eat(String food){
        System.out.println("吃的是"+ food);
        return "吃"+ food;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getHobby() {
        return hobby;
    }

    public void setHobby(String hobby) {
        this.hobby = hobby;
    }

    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", hobby='" + hobby + '\'' +
                '}';
    }
}
